package com.ITArmy.controller;

import com.ITArmy.common.ServerResponse;
import com.ITArmy.controller.base.BaseController;
import com.ITArmy.util.GetUserSession;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

@Api(value = "配置文件接口", tags = "个性配置")
@Controller
@RequestMapping("/config")
public class ConfigController extends BaseController {
    GetUserSession getUserSession = new GetUserSession();

    @RequestMapping("/getAllConfig")
    @ResponseBody
    @ApiOperation(value = "获取全部的主题)", notes = "获取全部的主题",
            httpMethod = "GET")
    public ServerResponse getAllConfig() {
        return ServerResponse.createBySuccess(configService.getAllConfig());
    }

    @RequestMapping("/changeTheme")
    @ResponseBody
    @ApiOperation(value = "用户修改自己的主题", notes = "用户修改自己的主题",
            httpMethod = "GET")
    public ServerResponse changeTheme(int configId) {

        return configService.changeTheme(configId, request);
    }
}
